package pers.cj.pdos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.RefundAnalysis;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2020-03-25
 */
public interface IRefundAnalysisService extends IService<RefundAnalysis> {
    Map getTotalData(String companyId,
                     String storeId,
                     String houseId,
                     Date date1,
                     Date date2);

    List<RefundAnalysis> listStoreData(String companyId, Integer page, Integer limit, String storeId, String houseId, Date date1, Date date2);

    List<RefundAnalysis> listHouseData(String companyId, Integer page, Integer limit, String storeId, String houseId, Date date1, Date date2);

    List<RefundAnalysis> listGoodsData(String companyId,
                                            Integer page,
                                            Integer limit,
                                            String storeId,
                                            String houseId,
                                            String customId,
                                            Date date1,
                                            Date date2,
                                            String typeId,
                                            Boolean filterZero,
                                            String search);
    Long countGoodsData(String companyId,
                        String storeId,
                        String houseId,
                        String customId,
                        Date date1,
                        Date date2,
                        String typeId,
                        Boolean filterZero,
                        String search);

    List<RefundAnalysis> listCustomData(String companyId,
                                              Integer page,
                                              Integer limit,
                                              String storeId,
                                              String houseId,
                                              Date date1,
                                              Date date2,
                                              String customTypeId,
                                              Boolean filterZero,
                                              String search);
    Long countCustomData(String companyId,
                         String storeId,
                         String houseId,
                         Date date1,
                         Date date2,
                         String customTypeId,
                         Boolean filterZero,
                         String search);

    BigDecimal getTotalCustom(String companyId,
                              String storeId,
                              String houseId,
                              Date date1,
                              Date date2,
                              String customTypeId,
                              Boolean filterZero,
                              String search);

    List<RefundAnalysis> listOrderData(String companyId,
                                            Integer page,
                                            Integer limit,
                                            String storeId,
                                            String houseId,
                                            Date date1,
                                            Date date2);
    Long countOrderData(String companyId,
                        String storeId,
                        String houseId,
                        Date date1,
                        Date date2);


    Map getHighGoods(String id, String storeId, String houseId, Date genDate, Date genDate1);

    Map getHighCustom(String id, String storeId, String houseId, Date genDate, Date genDate1);

    List<RefundAnalysis> listGoodsDetailDataByOrder(String companyId,
                                                                  String goodsId,
                                                                  Integer page,
                                                                  Integer limit,
                                                                  String storeId,
                                                                  String houseId,
                                                                  Date date1,
                                                                  Date date2,
                                                                  String search);
    Long countGoodsDetailDataByOrder(String companyId,
                                     String goodsId,
                                     String storeId,
                                     String houseId,
                                     Date date1,
                                     Date date2,
                                     String search);

    List<RefundAnalysis> listGoodsDetailDataByCustom(String companyId,
                                                                    String goodsId,
                                                                    Integer page,
                                                                    Integer limit,
                                                                    String storeId,
                                                                    String houseId,
                                                                    Date date1,
                                                                    Date date2,
                                                                    String search);
    Long countGoodsDetailDataByCustom(String companyId,
                                      String goodsId,
                                      String storeId,
                                      String houseId,
                                      Date date1,
                                      Date date2,
                                      String search);

    Map getMaxMinDate(String companyId, String goodsId, String customId, String storeId, String houseId);

    /**
     * 按照年份获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByYear(String companyId, String goodsId, String customId, String storeId, String houseId, Date date1, Date date2);

    /**
     * 按照月份获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByMonth(String companyId, String goodsId, String customId, String storeId, String houseId, Date date1, Date date2);

    /**
     * 按照日获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByDate(String companyId, String goodsId, String customId, String storeId, String houseId, Date date1, Date date2);
}
